package xfuzzy.alg_genetico.indeterminado.xfghlOld.model;

import java.util.Random;

/**
 * Singleton que nos dar� un Random
 * 
 * @author Sergio
 *
 */
public class XfghlSinglRandom {

	/**
	 * Instancia del singleton
	 */
	private static Random random=null;
	
	/**
	 * Valor de la semilla
	 */
	private static int seed;	
	
	/**
	 * Instancia del singleton
	 * @param seed2
	 */
	public static void initialize(int seed2)
	{
		seed=seed2;
		random=null;
	}
	
	public static Random getRandom()
	{
		if(random==null)
		{
			random=new Random(seed);
		}
		return random;
	}	
	
}
